package cn.iwit.util;

/**
 * 业务异常
 * 
 * @author shujq
 * 
 */
public class BusiException extends Exception {

    private static final long serialVersionUID = 3583566093089790852L;
    private String errcode;//错误代码6位，300000-899999,web层异常：300000-599999,service层异常：600000-899999，200000固定异常
    
    public static final String ERR_REQUESTDATA = "200001";//数据必填项
    public static final String ERR_INVALIDATA = "200002";//数据有效性错误
    public static final String ERR_WTC = "200003";//tuxedo调用失败
    public static final String ERR_SYSTEM = "200004";//系统异常
    public static final String ERR_SESSIONLOST = "200005";//会话丢失
    public static final String ERR_DBERROR = "200006";//数据库异常
    
    
    public BusiException(String errcode, String message) {
        super(message);
        this.errcode = errcode;
    }

    public BusiException(String errcode, String message, Throwable cause) {
        super(message, cause);
        this.errcode = errcode;
    }

    public String getErrcode() {
        return errcode;
    }
    
	public String getMessage() {
		if (errcode != null) {
				return errcode + ":" + super.getMessage();
		} else {
			return super.getMessage();
		}
	}
    
    public String getSuperMessage()
    {
            return super.getMessage();
    }
    
    
    
    
}
